import { apiUrl } from '@/common/js/Base.js';
export const medicine = {
    addPatient(obj) {
        return $ajax.post(apiUrl.apiUrl + 'congenicahelper/patient/addPatient', obj).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取药物基本信息
    getDrugById(obj){
        return $ajax.get(apiUrl.apiUrl + 'drug/getById.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取左侧树形菜单
    getTree(obj){
        return $ajax.get(apiUrl.apiUrl + 'Tree/getTree.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取靶点详情
    getTargetById(obj){
        return $ajax.get(apiUrl.apiUrl + 'target/getById.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取药物疗效
    getTargetByDrugId(obj){
        return $ajax.get(apiUrl.apiUrl + 'drug/getTargetByDrugId.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取药物代谢
    getPharmByDrugId(obj){
        return $ajax.get(apiUrl.apiUrl + 'drug/getPharmByDrugId.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取化学变异详情
    getpharmEvidentByRs(obj){
        return $ajax.get(apiUrl.apiUrl + 'pharmEvident/serachByRs.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取靶点变异详情
    getRsSerachById(obj){
        return $ajax.get(apiUrl.apiUrl + 'variant/serachById.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取药物基因组证据
    //geneid=PA278448&drugid=PA10040
    getPharmEvidentsByGeneId(obj){
        return $ajax.get(apiUrl.apiUrl + 'pharmEvident/getPharmEvidentsByGeneId.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取靶向证据
    //geneid=GID18&drugid=PA10040
    getTargetEvidentsByGeneId(obj){
        return $ajax.get(apiUrl.apiUrl + 'targtEvident/getTargetEvidentsByGeneId.action?', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //基因详情
    //id=GID14
    getGeneById(obj){
        return $ajax.get(apiUrl.apiUrl + 'gene/getById.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //药物相关作用
    //id=1
    getInteractionsByDrugId(obj){
        return $ajax.get(apiUrl.apiUrl + 'interaction/getInteractionsByDrugId.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //中国临床试验
    //id=1&orderStatus=desc|desc&orderTime=asc|desc'
    getChclinsByDrugId(obj){
        return $ajax.get(apiUrl.apiUrl + 'chclin/getChclinsByDrugId.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //世界临床试验
    //id=1&orderStatus=desc|desc&orderTime=asc|desc'
    getClinicaltrailsByDrugId(obj){
        return $ajax.get(apiUrl.apiUrl + 'clinicaltrail/getClinicaltrailsByDrugId.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //搜索
    drugSolrSerachAll(obj){
        return $ajax.get(apiUrl.apiUrl + 'serach/drugSolrSerachAll.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取药物相互作用详情
    //id=1
    getDrugInterDetails(obj){
        return $ajax.get(apiUrl.apiUrl + 'interaction/getById.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //中国临床试验详情
    //id=CTR20130888
    getChclinsById(obj){
        return $ajax.get(apiUrl.apiUrl + 'chclin/getById.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //世界临床试验详情
    //id=NCT00290485
    getClinicaltrailById(obj){
        return $ajax.get(apiUrl.apiUrl + 'clinicaltrail/getById.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //id=20180062
    getLableByDrugId(obj){
        return $ajax.get(apiUrl.apiUrl + 'drugHtmlLable/getLableByDrugId.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //获取首页数据
    getStatistics(obj){
        return $ajax.get(apiUrl.apiUrl + 'statistics/getStatistics.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data)
        })
    },
    //基因搜索
    //str=
    drugGeneSolrSerachAll(obj){
        return $ajax.get(apiUrl.apiUrl + 'serach/drugGeneSolrSerachAll.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data);
        })
    },
    //药物B搜索
    //drugName medicine
    interactionSolrSerachAll(obj){
        return $ajax.get(apiUrl.apiUrl + 'serach/interactionSolrSerachAll.action', { params: obj }).then(function(res) {
            return Promise.resolve(res.data);
        })
    },
}